package com.tt.dp.command.test;

import com.tt.dp.command.*;
import com.tt.dp.command.invoke.RemoteControl;
import com.tt.dp.command.model.*;

public class RemoteLoader {

    public static void main(String[] args) {
        RemoteControl remoteControl = new RemoteControl();

        Light light = new Light("living room");
        TV tv = new TV("living room");
        Stereo stereo = new Stereo();
        Hottub hottub = new Hottub();

        Command lightOnCommand = new LightOnCommand(light);
        Command tvOnCommand = new TVOnCommand(tv);
        Command stereoOnCommand = new StereoOnCommand(stereo);
        Command hottubOnCommand = new HottubOnCommand(hottub);

        Command lightOffCommand = new LightOffCommand(light);
        Command tvOffCommand = new TVOffCommand(tv);
        Command stereoOffCommand = new StereoOffCommand(stereo);
        Command hottubOffCommand = new HottubOffCommand(hottub);

        Command[] partyOns = {lightOnCommand,tvOnCommand,stereoOnCommand,hottubOnCommand};
        Command[] partyOffs = {lightOffCommand,tvOffCommand,stereoOffCommand,hottubOffCommand};

        Command macroOnCommand = new MacroCommand(partyOns);

        Command macroOffCommand = new MacroCommand(partyOffs);

        remoteControl.setCommand(0,macroOnCommand,macroOffCommand);

        remoteControl.onButtonWasPushed(0);
        remoteControl.offButtonWasPushed(0);
    }

//    public static void main(String[] args) {
//
//        RemoteControl remoteControl = new RemoteControl();
//
//        CeilingFan ceilingFan = new CeilingFan("living room");
//        Command ceilingFanHighCommand = new CeilingFanHighCommand(ceilingFan);
//        Command ceilingFanLowCommand = new CeilingFanLowCommand(ceilingFan);
//        Command ceilingFanMediumCommand = new CeilingFanMediumCommand(ceilingFan);
//        Command ceilingFanOffCommand = new CeilingFanOffCommand(ceilingFan);
//
//        remoteControl.setCommand(0, ceilingFanHighCommand, ceilingFanOffCommand);
//        remoteControl.setCommand(1, ceilingFanMediumCommand, ceilingFanOffCommand);
//        remoteControl.setCommand(2, ceilingFanLowCommand, ceilingFanOffCommand);
//
//        for (int i = 0; i < 3; i++) {
//            remoteControl.onButtonWasPushed(i);
//            remoteControl.offButtonWasPushed(i);
//            remoteControl.undoButtonWasPushed();
//        }
//    }

//    public static void main(String[] args) {
//        RemoteControl remoteControl = new RemoteControl();
//
//        Light livingRoom = new Light("livingRoom");
//        Light kitchen = new Light("kitchen");
//        Light masterBedRoom = new Light("masterBedroom");
//        Light stairs = new Light("stairs");
//        Light balcony = new Light("balcony");
//        Stereo stereo = new Stereo();
//        GarageDoor garageDoor = new GarageDoor();
//
//        Command livingRoomLightOffCommand = new LightOffCommand(livingRoom);
//        Command livingRoomLightOnCommand = new LightOnCommand(livingRoom);
//
//        Command kitchenLightOffCommand = new LightOffCommand(kitchen);
//        Command kitchenLightOnCommand = new LightOnCommand(kitchen);
//
//        Command masterBedRoomLightOffCommand = new LightOffCommand(masterBedRoom);
//        Command masterBedRoomLightOnCommand = new LightOnCommand(masterBedRoom);
//
//        Command stairsLightOffCommand = new LightOffCommand(stairs);
//        Command stairsLightOnCommand = new LightOnCommand(stairs);
//
//        Command balconyLightOffCommand = new LightOffCommand(balcony);
//        Command balconyLightOnCommand = new LightOnCommand(balcony);
//
//        Command stereoOnCommand = new StereoOnCommand(stereo);
//        Command stereoOffCommand = new StereoOffCommand(stereo);
//
//        Command garageDoorOpenCommand = new GarageDoorOpenCommand(garageDoor);
//        Command garageDoorDownCommand = new GarageDoorDownCommand(garageDoor);
//
//        remoteControl.setCommand(0, livingRoomLightOnCommand, livingRoomLightOffCommand);
//        remoteControl.setCommand(1, kitchenLightOnCommand, kitchenLightOffCommand);
//        remoteControl.setCommand(2, masterBedRoomLightOnCommand, masterBedRoomLightOffCommand);
//        remoteControl.setCommand(3, stairsLightOnCommand, stairsLightOffCommand);
//        remoteControl.setCommand(4, balconyLightOnCommand, balconyLightOffCommand);
//        remoteControl.setCommand(5, stereoOnCommand, stereoOffCommand);
//        remoteControl.setCommand(6, garageDoorOpenCommand, garageDoorDownCommand);
//
//        for (int i = 0; i < 7; i++) {
//            remoteControl.onButtonWasPushed(i);
//            remoteControl.offButtonWasPushed(i);
//            remoteControl.undoButtonWasPushed();
//        }
//    }
}
